package top.wugy.blog.model;

import com.jfinal.plugin.activerecord.IBean;
import com.jfinal.plugin.activerecord.Model;
import top.wugy.blog.kits.Const;

import java.util.Date;

/**
 * wugy on 2017/11/2 16:39
 */
public class TUser extends Model<TUser> implements IBean {

    public static final TUser dao = new TUser();

    public TUser setId(Integer id) {
        return set("id", id);
    }

    public Integer getId() {
        return get("id");
    }

    public String getUsername() {
        return get("username");
    }

    public TUser setUsername(String username) {
        return set("username", username);
    }

    public String getPassword() {
        return get("password");
    }

    public TUser setPassword(String password) {
        return set("password", password);
    }

    public Date getCreateTime() {
        return get("createTime");
    }

    public String getName() {
        return get("name");
    }

    public TUser setName(String name) {
        return set("name", name);
    }

    public TUser findByUsername(String username) {
        return findFirst("select * from " + Const.TABLE_USER + " where username = ?", username);
    }

}
